{% extends "layout.html" %}

{% block content %}
<div class="pb-2 mt-2 mb-4 border-bottom">
  <h3>All things</h3>
  <a class="col-md-3 btn btn-primary" href="/thing/create"><i class="far fa-wine-glass-alt fa-sm"></i> 创建一个Thing </a>

</div>
<div class="pb-2 mt-2 mb-4 ">

  {% for thing in things  %}
    <div>id:{{thing._id}}</div>
    <div>title:{{thing.title}}</div>
    <div>body:{{thing.body}}</div>
    <div>url:{{thing.url}}</div>
    <div class="border-bottom">    
      <a class="col-md-3 btn btn-primary" href="/thing/update/{{thing._id}}"><i class="far fa-wine-glass-alt fa-sm"></i> 更新 </a>
      <a class="col-md-3 btn btn-primary" href="/thing/read/{{thing._id}}"><i class="far fa-wine-glass-alt fa-sm"></i> 详情 </a>
      <a class="col-md-3 btn btn-primary" href="/thing/delete/{{thing._id}}" onclick="return confirm('Are you sure to delete?')"><i class="far fa-wine-glass-alt fa-sm"></i> 删除 </a>
    </div>


  {% endfor %}
</div>

{% endblock %}
